class BrandsController < ApplicationController
  #@brand = ""
  #@model = ""
  #@productionYear = 0
  #@engine = 0
  #@currentStatus = 0
  #@vin = ""
  #@licensePlate = ""
  #@color = ""
  def new

	 # @productionYear = ""

	  #@brand = params[:brand]
	  #@model = params[:model]
	  #@productionYear = params[:productionYear]
	  #@engine = params[:engine]
	  #@currentStatus = params[:currentStatus]
	  #@vin = params[:vin]
	  #@licensePlate = params[:licensePlate]
	  #@color = params[:color]

	  
  end

  def create 
	  @newBrand = Brand.new
	  @newModel = Model.new

	  @newModel.name = params[:model]
	  @newModel.productionYear = params[:productionYear]
	  @newModel.engine = params[:engine]
	  @newModel.idStatus = params[:currentStatus]
	  @newModel.vin = params[:vin]
	  @newModel.licensePlate = params[:licensePlate]
	  @newModel.color = params[:color]
	  @newModel.note = params[:note]

	  if @newModel.save
		  @newBrand.name = params[:brand]
		  @newBrand.idModel = @newModel.id

		  if @newBrand.save
			  redirect_to @newBrand
		  end
	  end
  end

  def show
	  @brand = Brand.find(params[:id])
	  @model = Model.find(params[:id])
  end
end
